package ui.panels;

import entities.User;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.border.EtchedBorder;
import manager.ManagerDriver;
import ui.windows.RemedySchedulerFrame;

public class ManagersPanel extends javax.swing.JPanel {

    /** Creates new form ManagersPanel */
    public ManagersPanel(RemedySchedulerFrame mainFrame) {
        initComponents();
        this.mainFrame = mainFrame;
        includeModel();
    }

    private void includeModel() {
        user = mainFrame.getUser();
        if (user.getTitle() != null && user.getTitle().length() != 0) {
            lbName.setText(user.getTitle());
        } else {
            lbName.setText(user.getLoginID());
        }

        new Thread() {

            @Override
            public void run() {
                while (true) {
                    SimpleDateFormat dateFormat = new SimpleDateFormat("EEE, MMM dd h:mm a");
                    lbTime.setText(dateFormat.format(Calendar.getInstance().getTime()));
                    try {
                        sleep(1000);
                    } catch (InterruptedException ex) {
                        ex.printStackTrace();
                    }
                }
            }
        }.start();

        introductionPanel = new IntroductionPanel();
        eManagementPanel = new EmployeeManagementPanel(mainFrame);
        editHSchedulerPanel = new HeadSchedulerManagementPanel(mainFrame);
        editHShiftRequestPanel = new HSRManagementPanel(mainFrame);
        editHolidayPanel = new EditHolidayPanel(mainFrame);
        editTimeSlotPanel = new TimeSlotManagementPanel(mainFrame);
        depManagementPanel = new DepartmentManagementPanel(mainFrame);
        viewProfilePanel = new ViewProfilePanel(user);
        editProfilePanel = new EditProfilePanel(mainFrame);
        changePassAPanel = new ChangePassPanel(mainFrame);
        showStartPage();
        timePanel = new TimePanel(mainFrame);
        timePanel.setBorder(new EtchedBorder());
        expandMenu1 = true;
        expandMenu2 = true;
        expandMenu3 = true;
        expandMenu4 = true;
    }
    
    public void reLoad() {
        introductionPanel = new IntroductionPanel();
        eManagementPanel = new EmployeeManagementPanel(mainFrame);
        editHSchedulerPanel = new HeadSchedulerManagementPanel(mainFrame);
        editHShiftRequestPanel = new HSRManagementPanel(mainFrame);
        editHolidayPanel = new EditHolidayPanel(mainFrame);
        editTimeSlotPanel = new TimeSlotManagementPanel(mainFrame);
        depManagementPanel = new DepartmentManagementPanel(mainFrame);
        viewProfilePanel = new ViewProfilePanel(user);
        editProfilePanel = new EditProfilePanel(mainFrame);
        changePassAPanel = new ChangePassPanel(mainFrame);
    }

    private void switchTarget(int choise) {
        if (target != choise) {
            switch (target) {
                case 0:
                    break;
                case 1:
                    lbStartPage.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 2:
                    lbEManagementM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 3:
                    lbCreateEM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 4:
                    lbChagerSheetM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 5:
                    lbCreateCSM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 6:
                    lbShiftRequestM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 7:
                    lbHolidayM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 8:
                    lbCreateHolidayM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 9:
                    lbTimeSlotM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 10:
                    lbDepMM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 11:
                    lbViewPM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 12:
                    lbEditPM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 13:
                    lbChangePassM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
                case 14:
                    lbHelpM.setFont(new Font("Tahoma", Font.PLAIN, 11));
                    break;
            }
            target = choise;
            this.remove(viewControl);
            this.repaint();
            switch (choise) {
                case 0:
                    viewControl = new JScrollPane(introductionPanel);
                    break;
                case 1:
                    viewControl = new JScrollPane(startPage);
                    lbStartPage.setFont(new Font("Tahoma", Font.BOLD, 11));
                    lbStartPage.setBackground(Color.white);
                    break;
                case 2:
                    eManagementPanel.showAllEmployee();
                    viewControl = new JScrollPane(eManagementPanel);
                    lbEManagementM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 3:
                    eManagementPanel.showCreateEmployee();
                    viewControl = new JScrollPane(eManagementPanel);
                    lbCreateEM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 4:
                    editHSchedulerPanel.showAllScheduler();
                    viewControl = new JScrollPane(editHSchedulerPanel);
                    lbChagerSheetM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 5:
                    editHSchedulerPanel.showCreateScheduler();
                    viewControl = new JScrollPane(editHSchedulerPanel);
                    lbCreateCSM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 6:
                    viewControl = new JScrollPane(editHShiftRequestPanel);
                    lbShiftRequestM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 7:
                    editHolidayPanel.showAllHoliday();
                    viewControl = new JScrollPane(editHolidayPanel);
                    lbHolidayM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 8:
                    editHolidayPanel.showCreateHoliday();
                    viewControl = new JScrollPane(editHolidayPanel);
                    lbCreateHolidayM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 9:
                    viewControl = new JScrollPane(editTimeSlotPanel);
                    lbTimeSlotM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 10:
                    viewControl = new JScrollPane(depManagementPanel);
                    lbDepMM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 11:
                    viewControl = new JScrollPane(viewProfilePanel);
                    lbViewPM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 12:
                    viewControl = new JScrollPane(editProfilePanel);
                    lbEditPM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 13:
                    viewControl = new JScrollPane(changePassAPanel);
                    lbChangePassM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
                case 14:
                    viewControl = new JScrollPane();
                    lbHelpM.setFont(new Font("Tahoma", Font.BOLD, 11));
                    break;
            }
            this.add(viewControl, BorderLayout.CENTER);
            this.revalidate();
        }
    }

    private void showIntroduction() {
        switchTarget(0);
    }

    private void showStartPage() {
        switchTarget(1);
    }

    private void showEManagement() {
        switchTarget(2);
    }

    private void showCreateEmployee() {
        switchTarget(3);
    }

    private void showHScheduler() {
        switchTarget(4);
    }

    private void showCreateHScheduler() {
        switchTarget(5);
    }

    private void showHShiftRequest() {
        switchTarget(6);
    }

    private void showHolidayManagement() {
        switchTarget(7);
    }

    private void showCreateHoliday() {
        switchTarget(8);
    }

    private void showEditTimeSlot() {
        switchTarget(9);
    }
    
    private void showDepartmentManagement() {
        switchTarget(10);
    }

    private void showViewP() {
        switchTarget(11);
    }

    private void showEditP() {
        switchTarget(12);
    }

    private void showChangePass() {
        switchTarget(13);
    }

    private void showHelp() {
        switchTarget(14);
    }

    private void showHireControler() {
        if (showControler) {
            this.remove(controler);
            lbOpenControler.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand2_15.gif")));
            showControler = false;
        } else {
            this.add(controler, BorderLayout.WEST);
            lbOpenControler.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand1_15.gif")));
            showControler = true;
        }
        this.revalidate();
    }

    private void showHireTimer() {
        if (!showTimer) {
            this.add(timePanel, BorderLayout.EAST);
            lbOpenTimer.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand2_15.gif")));
            showTimer = true;
        } else {
            this.remove(timePanel);
            lbOpenTimer.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/expand1_15.gif")));
            showTimer = false;
        }
        this.revalidate();
    }
    
    private void expandMenu1() {
        if(expandMenu1) {
            new Thread() {
                @Override
                public void run() {
                    menu1.remove(lbCreateEM);
                    menu1.repaint();
                    sleepTime(25);
                    menu1.remove(lbEManagementM);
                    menu1.repaint();
                    sleepTime(25);
                    menu1.remove(lbStartPage);
                    menu1.repaint();
                    controler.revalidate();
                    lbEManagementTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                } 
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu1 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu1.add(lbStartPage);
                    menu1.revalidate();
                    sleepTime(25);
                    menu1.add(lbEManagementM);
                    menu1.revalidate();
                    sleepTime(25);
                    menu1.add(lbCreateEM);
                    menu1.revalidate();
                    controler.revalidate();
                    lbEManagementTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                } 
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu1 = true;
        }
    }
    
    private void expandMenu2() {
        if(expandMenu2) {
            new Thread() {
                @Override
                public void run() {
                    menu2.remove(lbChagerSheetM);
                    menu2.repaint();
                    sleepTime(25);
                    menu2.remove(lbCreateCSM);
                    menu2.repaint();
                    sleepTime(25);
                    menu2.remove(lbShiftRequestM);
                    menu2.repaint();
                    sleepTime(25);
                    menu2.remove(lbHolidayM);
                    menu2.repaint();
                    sleepTime(25);
                    menu2.remove(lbCreateHolidayM);
                    menu2.repaint();
                    sleepTime(25);
                    menu2.remove(lbTimeSlotM);
                    menu2.repaint();
                    controler.revalidate();
                    lbSchedulerTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                }   
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu2 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu2.add(lbChagerSheetM);
                    menu2.revalidate();
                    sleepTime(25);
                    menu2.add(lbCreateCSM);
                    menu2.revalidate();
                    sleepTime(25);
                    menu2.add(lbShiftRequestM);
                    menu2.revalidate();
                    sleepTime(25);
                    menu2.add(lbHolidayM);
                    menu2.revalidate();
                    sleepTime(25);
                    menu2.add(lbCreateHolidayM);
                    menu2.revalidate();
                    sleepTime(25);
                    menu2.add(lbTimeSlotM);
                    menu2.revalidate();
                    controler.revalidate();
                    lbSchedulerTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                }   
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu2 = true;
        }
    }
    
    private void expandMenu3() {
        if(expandMenu3) {
            new Thread() {
                @Override
                public void run() {
                    menu3.remove(lbDepMM);
                    menu3.repaint();
                    controler.revalidate();
                    lbDepMTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                }                
            }.start();
            expandMenu3 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu3.add(lbDepMM);
                    menu3.revalidate();
                    controler.revalidate();
                    lbDepMTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                }                
            }.start();
            expandMenu3 = true;
        }
    }
    
    private void expandMenu4() {
        if(expandMenu4) {
            new Thread() {
                @Override
                public void run() {
                    menu4.remove(lbHelpM);
                    menu4.repaint();
                    sleepTime(25);
                    menu4.remove(lbChangePassM);
                    menu4.repaint();
                    sleepTime(25);
                    menu4.remove(lbEditPM);
                    menu4.repaint();
                    sleepTime(25);
                    menu4.remove(lbViewPM);
                    menu4.repaint();
                    controler.revalidate();
                    lbOperationTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand-15.gif")));
                } 
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu4 = false;
        } else {
            new Thread() {
                @Override
                public void run() {
                    menu4.add(lbHelpM);
                    menu4.revalidate();
                    sleepTime(25);
                    menu4.add(lbChangePassM);
                    menu4.revalidate();
                    sleepTime(25);
                    menu4.add(lbEditPM);
                    menu4.revalidate();
                    sleepTime(25);
                    menu4.add(lbViewPM);
                    menu4.revalidate();
                    controler.revalidate();
                    lbOperationTab.setIcon(new ImageIcon(mainFrame.getClass().getResource("/ui/images/icon_expand1-15.gif")));
                } 
                public void sleepTime(long time) {
                    try {
                        sleep(time);
                    } catch (InterruptedException ex) {
                        Logger.getLogger(ManagersPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }.start();
            expandMenu4 = true;
        }
    }        

    private void logout() {
        boolean logout = mainFrame.logout();
        if (!logout) {
            JOptionPane.showMessageDialog(null, "Cannot logout", "Error", JOptionPane.WARNING_MESSAGE);
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        lbHeader = new javax.swing.JLabel();
        lbDep = new javax.swing.JLabel();
        lbTime = new javax.swing.JLabel();
        lbLogout = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        lbEditP = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        lbName = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        lbOpenControler = new javax.swing.JLabel();
        lbOpenTimer = new javax.swing.JLabel();
        controler = new javax.swing.JScrollPane();
        jPanel3 = new javax.swing.JPanel();
        lbEManagementTab = new javax.swing.JLabel();
        menu1 = new javax.swing.JPanel();
        lbStartPage = new javax.swing.JLabel();
        lbEManagementM = new javax.swing.JLabel();
        lbCreateEM = new javax.swing.JLabel();
        lbSchedulerTab = new javax.swing.JLabel();
        menu2 = new javax.swing.JPanel();
        lbChagerSheetM = new javax.swing.JLabel();
        lbCreateCSM = new javax.swing.JLabel();
        lbShiftRequestM = new javax.swing.JLabel();
        lbHolidayM = new javax.swing.JLabel();
        lbCreateHolidayM = new javax.swing.JLabel();
        lbTimeSlotM = new javax.swing.JLabel();
        lbOperationTab = new javax.swing.JLabel();
        menu4 = new javax.swing.JPanel();
        lbViewPM = new javax.swing.JLabel();
        lbEditPM = new javax.swing.JLabel();
        lbChangePassM = new javax.swing.JLabel();
        lbHelpM = new javax.swing.JLabel();
        lbDepMTab = new javax.swing.JLabel();
        menu3 = new javax.swing.JPanel();
        lbDepMM = new javax.swing.JLabel();
        viewControl = new javax.swing.JScrollPane();
        startPage = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jButton5 = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();

        setLayout(new java.awt.BorderLayout());

        jPanel1.setBackground(new java.awt.Color(102, 0, 0));
        jPanel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED, null, null, null, new java.awt.Color(102, 0, 0)));

        lbHeader.setFont(new java.awt.Font("Agency FB", 1, 24));
        lbHeader.setForeground(new java.awt.Color(255, 255, 51));
        lbHeader.setText("Remedy Scheduler");

        lbDep.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbDep.setForeground(new java.awt.Color(255, 255, 51));
        lbDep.setText("Manager");

        lbTime.setFont(new java.awt.Font("Tahoma", 1, 11));
        lbTime.setForeground(new java.awt.Color(204, 255, 204));
        lbTime.setText("Time");

        lbLogout.setForeground(new java.awt.Color(204, 255, 204));
        lbLogout.setText("Logout");
        lbLogout.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbLogoutMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbLogoutMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbLogoutMouseExited(evt);
            }
        });

        jLabel5.setForeground(new java.awt.Color(204, 255, 204));
        jLabel5.setText("|");

        lbEditP.setForeground(new java.awt.Color(204, 255, 204));
        lbEditP.setText("Edit Profile");
        lbEditP.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbEditPMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbEditPMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbEditPMouseExited(evt);
            }
        });

        jLabel7.setForeground(new java.awt.Color(204, 255, 204));
        jLabel7.setText("Hi");

        lbName.setFont(new java.awt.Font("Tahoma", 1, 11));
        lbName.setForeground(new java.awt.Color(204, 255, 204));
        lbName.setText("Name");
        lbName.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbNameMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbNameMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbNameMouseExited(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(lbDep)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 336, Short.MAX_VALUE)
                        .addComponent(jLabel7)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbName)
                        .addGap(138, 138, 138)
                        .addComponent(lbEditP)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel5)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(lbLogout))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lbHeader)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 512, Short.MAX_VALUE)
                        .addComponent(lbTime)))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lbTime)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(lbHeader)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbDep)
                            .addComponent(lbLogout)
                            .addComponent(jLabel5)
                            .addComponent(lbEditP)
                            .addComponent(jLabel7)
                            .addComponent(lbName))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        add(jPanel1, java.awt.BorderLayout.PAGE_START);

        lbOpenControler.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/expand1_15.gif"))); // NOI18N
        lbOpenControler.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOpenControlerMouseClicked(evt);
            }
        });

        lbOpenTimer.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/expand1_15.gif"))); // NOI18N
        lbOpenTimer.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOpenTimerMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbOpenControler)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 658, Short.MAX_VALUE)
                .addComponent(lbOpenTimer)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(lbOpenControler)
                .addComponent(lbOpenTimer))
        );

        add(jPanel2, java.awt.BorderLayout.PAGE_END);

        controler.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        controler.setPreferredSize(new java.awt.Dimension(210, 180));

        jPanel3.setBackground(new java.awt.Color(153, 255, 255));

        lbEManagementTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbEManagementTab.setForeground(new java.awt.Color(102, 102, 102));
        lbEManagementTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbEManagementTab.setText("Employee management");
        lbEManagementTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbEManagementTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbEManagementTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbEManagementTabMouseExited(evt);
            }
        });

        menu1.setBackground(new java.awt.Color(153, 255, 255));
        menu1.setLayout(new java.awt.GridLayout(0, 1));

        lbStartPage.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        lbStartPage.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbStartPage.setText("Start page");
        lbStartPage.setPreferredSize(new java.awt.Dimension(34, 25));
        lbStartPage.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbStartPageMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbStartPageMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbStartPageMouseExited(evt);
            }
        });
        menu1.add(lbStartPage);

        lbEManagementM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbEManagementM.setText("Employee management");
        lbEManagementM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbEManagementM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbEManagementMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbEManagementMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbEManagementMMouseExited(evt);
            }
        });
        menu1.add(lbEManagementM);

        lbCreateEM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbCreateEM.setText("Create new employee");
        lbCreateEM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbCreateEM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbCreateEMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbCreateEMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbCreateEMMouseExited(evt);
            }
        });
        menu1.add(lbCreateEM);

        lbSchedulerTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbSchedulerTab.setForeground(new java.awt.Color(102, 102, 102));
        lbSchedulerTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbSchedulerTab.setText("Scheduler management");
        lbSchedulerTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbSchedulerTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbSchedulerTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbSchedulerTabMouseExited(evt);
            }
        });

        menu2.setBackground(new java.awt.Color(153, 255, 255));
        menu2.setLayout(new java.awt.GridLayout(0, 1));

        lbChagerSheetM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbChagerSheetM.setText("Head's chager sheet");
        lbChagerSheetM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbChagerSheetM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbChagerSheetMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbChagerSheetMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbChagerSheetMMouseExited(evt);
            }
        });
        menu2.add(lbChagerSheetM);

        lbCreateCSM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbCreateCSM.setText("Create chager sheet");
        lbCreateCSM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbCreateCSMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbCreateCSMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbCreateCSMMouseExited(evt);
            }
        });
        menu2.add(lbCreateCSM);

        lbShiftRequestM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbShiftRequestM.setText("Head's shift request");
        lbShiftRequestM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbShiftRequestM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbShiftRequestMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbShiftRequestMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbShiftRequestMMouseExited(evt);
            }
        });
        menu2.add(lbShiftRequestM);

        lbHolidayM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbHolidayM.setText("Holiday management");
        lbHolidayM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbHolidayM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbHolidayMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbHolidayMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbHolidayMMouseExited(evt);
            }
        });
        menu2.add(lbHolidayM);

        lbCreateHolidayM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbCreateHolidayM.setText("Create new holiday");
        lbCreateHolidayM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbCreateHolidayM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbCreateHolidayMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbCreateHolidayMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbCreateHolidayMMouseExited(evt);
            }
        });
        menu2.add(lbCreateHolidayM);

        lbTimeSlotM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbTimeSlotM.setText("Edit Timeslot");
        lbTimeSlotM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbTimeSlotM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbTimeSlotMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbTimeSlotMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbTimeSlotMMouseExited(evt);
            }
        });
        menu2.add(lbTimeSlotM);

        lbOperationTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbOperationTab.setForeground(new java.awt.Color(102, 102, 102));
        lbOperationTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbOperationTab.setText("Operations");
        lbOperationTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbOperationTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbOperationTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbOperationTabMouseExited(evt);
            }
        });

        menu4.setBackground(new java.awt.Color(153, 255, 255));
        menu4.setLayout(new java.awt.GridLayout(0, 1));

        lbViewPM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbViewPM.setText("View profile");
        lbViewPM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbViewPM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbViewPMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbViewPMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbViewPMMouseExited(evt);
            }
        });
        menu4.add(lbViewPM);

        lbEditPM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbEditPM.setText("Edit profile");
        lbEditPM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbEditPM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbEditPMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbEditPMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbEditPMMouseExited(evt);
            }
        });
        menu4.add(lbEditPM);

        lbChangePassM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbChangePassM.setText("Change password");
        lbChangePassM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbChangePassM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbChangePassMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbChangePassMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbChangePassMMouseExited(evt);
            }
        });
        menu4.add(lbChangePassM);

        lbHelpM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbHelpM.setText("Help");
        lbHelpM.setPreferredSize(new java.awt.Dimension(40, 25));
        lbHelpM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbHelpMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbHelpMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbHelpMMouseExited(evt);
            }
        });
        menu4.add(lbHelpM);

        lbDepMTab.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbDepMTab.setForeground(new java.awt.Color(102, 102, 102));
        lbDepMTab.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/icon_expand1-15.gif"))); // NOI18N
        lbDepMTab.setText("Department");
        lbDepMTab.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbDepMTabMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbDepMTabMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbDepMTabMouseExited(evt);
            }
        });

        menu3.setBackground(new java.awt.Color(153, 255, 255));
        menu3.setLayout(new java.awt.GridLayout(0, 1));

        lbDepMM.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/bullet-black (1).png"))); // NOI18N
        lbDepMM.setText("Department Management");
        lbDepMM.setPreferredSize(new java.awt.Dimension(34, 25));
        lbDepMM.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                lbDepMMMouseClicked(evt);
            }
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                lbDepMMMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                lbDepMMMouseExited(evt);
            }
        });
        menu3.add(lbDepMM);

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lbEManagementTab)
                .addContainerGap())
            .addComponent(menu1, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lbSchedulerTab)
                .addContainerGap())
            .addComponent(menu2, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lbDepMTab)
                .addContainerGap())
            .addComponent(menu3, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(lbOperationTab)
                .addContainerGap())
            .addComponent(menu4, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbEManagementTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbSchedulerTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbDepMTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lbOperationTab)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(menu4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(111, Short.MAX_VALUE))
        );

        controler.setViewportView(jPanel3);

        add(controler, java.awt.BorderLayout.LINE_START);

        startPage.setBackground(new java.awt.Color(255, 255, 255));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel1.setForeground(new java.awt.Color(102, 102, 102));
        jLabel1.setText("Operations:");

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/employees-50.png"))); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/adduser-50.png"))); // NOI18N
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/doc-50.png"))); // NOI18N
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/calendar-50.png"))); // NOI18N
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 9));
        jLabel2.setForeground(new java.awt.Color(102, 102, 102));
        jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel2.setText("emloyee's");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 9));
        jLabel3.setForeground(new java.awt.Color(102, 102, 102));
        jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel3.setText("add employee");

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 9));
        jLabel4.setForeground(new java.awt.Color(102, 102, 102));
        jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel4.setText("scheduler");

        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ui/images/request.png"))); // NOI18N
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 9));
        jLabel6.setForeground(new java.awt.Color(102, 102, 102));
        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel6.setText("request");

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 9));
        jLabel9.setForeground(new java.awt.Color(102, 102, 102));
        jLabel9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel9.setText("holiday");

        javax.swing.GroupLayout startPageLayout = new javax.swing.GroupLayout(startPage);
        startPage.setLayout(startPageLayout);
        startPageLayout.setHorizontalGroup(
            startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(startPageLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(startPageLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addComponent(jLabel1))
                .addContainerGap(186, Short.MAX_VALUE))
        );
        startPageLayout.setVerticalGroup(
            startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(startPageLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton4)
                    .addComponent(jButton5)
                    .addGroup(startPageLayout.createSequentialGroup()
                        .addComponent(jButton3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(jLabel6)
                            .addComponent(jLabel9)))
                    .addComponent(jButton2)
                    .addGroup(startPageLayout.createSequentialGroup()
                        .addComponent(jButton1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(startPageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(jLabel3))))
                .addContainerGap(282, Short.MAX_VALUE))
        );

        viewControl.setViewportView(startPage);

        add(viewControl, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

private void lbNameMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNameMouseClicked
    showViewP();
}//GEN-LAST:event_lbNameMouseClicked

private void lbNameMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNameMouseEntered
    lbName.setForeground(Color.yellow);
}//GEN-LAST:event_lbNameMouseEntered

private void lbNameMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbNameMouseExited
    lbName.setForeground(new Color(204, 255, 204));
}//GEN-LAST:event_lbNameMouseExited

private void lbEditPMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMouseClicked
    showEditP();
}//GEN-LAST:event_lbEditPMouseClicked

private void lbEditPMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMouseEntered
    lbEditP.setForeground(Color.yellow);
}//GEN-LAST:event_lbEditPMouseEntered

private void lbEditPMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMouseExited
    lbEditP.setForeground(new Color(204, 255, 204));
}//GEN-LAST:event_lbEditPMouseExited

private void lbLogoutMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbLogoutMouseClicked
    logout();
}//GEN-LAST:event_lbLogoutMouseClicked

private void lbLogoutMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbLogoutMouseEntered
    lbLogout.setForeground(Color.yellow);
}//GEN-LAST:event_lbLogoutMouseEntered

private void lbLogoutMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbLogoutMouseExited
    lbLogout.setForeground(new Color(204, 255, 204));
}//GEN-LAST:event_lbLogoutMouseExited

private void lbEManagementTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEManagementTabMouseClicked
    expandMenu1();
}//GEN-LAST:event_lbEManagementTabMouseClicked

private void lbEManagementTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEManagementTabMouseEntered
    lbEManagementTab.setForeground(Color.red);
}//GEN-LAST:event_lbEManagementTabMouseEntered

private void lbEManagementTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEManagementTabMouseExited
    lbEManagementTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbEManagementTabMouseExited

private void lbSchedulerTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerTabMouseClicked
    expandMenu2();
}//GEN-LAST:event_lbSchedulerTabMouseClicked

private void lbSchedulerTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerTabMouseEntered
    lbSchedulerTab.setForeground(Color.red);
}//GEN-LAST:event_lbSchedulerTabMouseEntered

private void lbSchedulerTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbSchedulerTabMouseExited
    lbSchedulerTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbSchedulerTabMouseExited

private void lbOperationTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOperationTabMouseClicked
    expandMenu4();
}//GEN-LAST:event_lbOperationTabMouseClicked

private void lbOperationTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOperationTabMouseEntered
    lbOperationTab.setForeground(Color.red);
}//GEN-LAST:event_lbOperationTabMouseEntered

private void lbOperationTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOperationTabMouseExited
    lbOperationTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbOperationTabMouseExited

private void lbStartPageMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbStartPageMouseClicked
    showStartPage();
}//GEN-LAST:event_lbStartPageMouseClicked

private void lbStartPageMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbStartPageMouseEntered
    lbStartPage.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbStartPageMouseEntered

private void lbStartPageMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbStartPageMouseExited
    lbStartPage.setBorder(null);
}//GEN-LAST:event_lbStartPageMouseExited

private void lbEManagementMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEManagementMMouseClicked
    showEManagement();
}//GEN-LAST:event_lbEManagementMMouseClicked

private void lbEManagementMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEManagementMMouseEntered
    lbEManagementM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbEManagementMMouseEntered

private void lbEManagementMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEManagementMMouseExited
    lbEManagementM.setBorder(null);
}//GEN-LAST:event_lbEManagementMMouseExited

private void lbCreateEMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreateEMMouseClicked
    showCreateEmployee();
}//GEN-LAST:event_lbCreateEMMouseClicked

private void lbCreateEMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreateEMMouseEntered
    lbCreateEM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbCreateEMMouseEntered

private void lbCreateEMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreateEMMouseExited
    lbCreateEM.setBorder(null);
}//GEN-LAST:event_lbCreateEMMouseExited

private void lbChagerSheetMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChagerSheetMMouseClicked
    showHScheduler();
}//GEN-LAST:event_lbChagerSheetMMouseClicked

private void lbChagerSheetMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChagerSheetMMouseEntered
    lbChagerSheetM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbChagerSheetMMouseEntered

private void lbChagerSheetMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChagerSheetMMouseExited
    lbChagerSheetM.setBorder(null);
}//GEN-LAST:event_lbChagerSheetMMouseExited

private void lbCreateCSMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreateCSMMouseClicked
    showCreateHScheduler();
}//GEN-LAST:event_lbCreateCSMMouseClicked

private void lbCreateCSMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreateCSMMouseEntered
    lbCreateCSM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbCreateCSMMouseEntered

private void lbCreateCSMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreateCSMMouseExited
    lbCreateCSM.setBorder(null);
}//GEN-LAST:event_lbCreateCSMMouseExited

private void lbShiftRequestMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbShiftRequestMMouseClicked
    showHShiftRequest();
}//GEN-LAST:event_lbShiftRequestMMouseClicked

private void lbShiftRequestMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbShiftRequestMMouseEntered
    lbShiftRequestM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbShiftRequestMMouseEntered

private void lbShiftRequestMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbShiftRequestMMouseExited
    lbShiftRequestM.setBorder(null);
}//GEN-LAST:event_lbShiftRequestMMouseExited

private void lbHolidayMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHolidayMMouseClicked
    showHolidayManagement();
}//GEN-LAST:event_lbHolidayMMouseClicked

private void lbHolidayMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHolidayMMouseEntered
    lbHolidayM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbHolidayMMouseEntered

private void lbHolidayMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHolidayMMouseExited
    lbHolidayM.setBorder(null);
}//GEN-LAST:event_lbHolidayMMouseExited

private void lbCreateHolidayMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreateHolidayMMouseClicked
    showCreateHoliday();
}//GEN-LAST:event_lbCreateHolidayMMouseClicked

private void lbCreateHolidayMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreateHolidayMMouseEntered
    lbCreateHolidayM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbCreateHolidayMMouseEntered

private void lbCreateHolidayMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbCreateHolidayMMouseExited
    lbCreateHolidayM.setBorder(null);
}//GEN-LAST:event_lbCreateHolidayMMouseExited

private void lbTimeSlotMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbTimeSlotMMouseClicked
    showEditTimeSlot();
}//GEN-LAST:event_lbTimeSlotMMouseClicked

private void lbTimeSlotMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbTimeSlotMMouseEntered
    lbTimeSlotM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbTimeSlotMMouseEntered

private void lbTimeSlotMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbTimeSlotMMouseExited
    lbTimeSlotM.setBorder(null);
}//GEN-LAST:event_lbTimeSlotMMouseExited

private void lbViewPMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewPMMouseClicked
    showViewP();
}//GEN-LAST:event_lbViewPMMouseClicked

private void lbViewPMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewPMMouseEntered
    lbViewPM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbViewPMMouseEntered

private void lbViewPMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbViewPMMouseExited
    lbViewPM.setBorder(null);
}//GEN-LAST:event_lbViewPMMouseExited

private void lbEditPMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMMouseClicked
    showEditP();
}//GEN-LAST:event_lbEditPMMouseClicked

private void lbEditPMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMMouseEntered
    lbEditPM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbEditPMMouseEntered

private void lbEditPMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbEditPMMouseExited
    lbEditPM.setBorder(null);
}//GEN-LAST:event_lbEditPMMouseExited

private void lbChangePassMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChangePassMMouseClicked
    showChangePass();
}//GEN-LAST:event_lbChangePassMMouseClicked

private void lbChangePassMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChangePassMMouseEntered
    lbChangePassM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbChangePassMMouseEntered

private void lbChangePassMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbChangePassMMouseExited
    lbChangePassM.setBorder(null);
}//GEN-LAST:event_lbChangePassMMouseExited

private void lbHelpMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHelpMMouseClicked
    showHelp();
}//GEN-LAST:event_lbHelpMMouseClicked

private void lbHelpMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHelpMMouseEntered
    lbHelpM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbHelpMMouseEntered

private void lbHelpMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbHelpMMouseExited
    lbHelpM.setBorder(null);
}//GEN-LAST:event_lbHelpMMouseExited

private void lbOpenControlerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOpenControlerMouseClicked
    showHireControler();
}//GEN-LAST:event_lbOpenControlerMouseClicked

private void lbOpenTimerMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbOpenTimerMouseClicked
    showHireTimer();
}//GEN-LAST:event_lbOpenTimerMouseClicked

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    showEManagement();
}//GEN-LAST:event_jButton1ActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    showCreateEmployee();
}//GEN-LAST:event_jButton2ActionPerformed

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
    showHScheduler();
}//GEN-LAST:event_jButton3ActionPerformed

private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
    showHShiftRequest();
}//GEN-LAST:event_jButton5ActionPerformed

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
    showHolidayManagement();
}//GEN-LAST:event_jButton4ActionPerformed

private void lbDepMMMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbDepMMMouseClicked
    showDepartmentManagement();
}//GEN-LAST:event_lbDepMMMouseClicked

private void lbDepMMMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbDepMMMouseEntered
    lbDepMM.setBorder(new EtchedBorder());
}//GEN-LAST:event_lbDepMMMouseEntered

private void lbDepMMMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbDepMMMouseExited
    lbDepMM.setBorder(null);
}//GEN-LAST:event_lbDepMMMouseExited

private void lbDepMTabMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbDepMTabMouseClicked
    expandMenu3();
}//GEN-LAST:event_lbDepMTabMouseClicked

private void lbDepMTabMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbDepMTabMouseEntered
    lbDepMTab.setForeground(Color.red);
}//GEN-LAST:event_lbDepMTabMouseEntered

private void lbDepMTabMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_lbDepMTabMouseExited
    lbDepMTab.setForeground(new Color(102, 102, 102));
}//GEN-LAST:event_lbDepMTabMouseExited
    private RemedySchedulerFrame mainFrame;
    private ManagerDriver driver;
    private User user;
    private IntroductionPanel introductionPanel;
    private EmployeeManagementPanel eManagementPanel;
    private HeadSchedulerManagementPanel editHSchedulerPanel;
    private HSRManagementPanel editHShiftRequestPanel;
    private EditHolidayPanel editHolidayPanel;
    private TimeSlotManagementPanel editTimeSlotPanel;
    private DepartmentManagementPanel depManagementPanel;
    private ViewProfilePanel viewProfilePanel;
    private EditProfilePanel editProfilePanel;
    private ChangePassPanel changePassAPanel;
    private JPanel currentPanel;
    private TimePanel timePanel;
    private boolean showControler = true;
    private boolean showTimer = false;
    private int target;
    private boolean expandMenu1, expandMenu2, expandMenu3, expandMenu4;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane controler;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JLabel lbChagerSheetM;
    private javax.swing.JLabel lbChangePassM;
    private javax.swing.JLabel lbCreateCSM;
    private javax.swing.JLabel lbCreateEM;
    private javax.swing.JLabel lbCreateHolidayM;
    private javax.swing.JLabel lbDep;
    private javax.swing.JLabel lbDepMM;
    private javax.swing.JLabel lbDepMTab;
    private javax.swing.JLabel lbEManagementM;
    private javax.swing.JLabel lbEManagementTab;
    private javax.swing.JLabel lbEditP;
    private javax.swing.JLabel lbEditPM;
    private javax.swing.JLabel lbHeader;
    private javax.swing.JLabel lbHelpM;
    private javax.swing.JLabel lbHolidayM;
    private javax.swing.JLabel lbLogout;
    private javax.swing.JLabel lbName;
    private javax.swing.JLabel lbOpenControler;
    private javax.swing.JLabel lbOpenTimer;
    private javax.swing.JLabel lbOperationTab;
    private javax.swing.JLabel lbSchedulerTab;
    private javax.swing.JLabel lbShiftRequestM;
    private javax.swing.JLabel lbStartPage;
    private javax.swing.JLabel lbTime;
    private javax.swing.JLabel lbTimeSlotM;
    private javax.swing.JLabel lbViewPM;
    private javax.swing.JPanel menu1;
    private javax.swing.JPanel menu2;
    private javax.swing.JPanel menu3;
    private javax.swing.JPanel menu4;
    private javax.swing.JPanel startPage;
    private javax.swing.JScrollPane viewControl;
    // End of variables declaration//GEN-END:variables
}
